home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!xlink.net!rz.uni-karlsruhe.de!stepsun.uni-kl.de!uklirb.informatik.uni-kl.de!feck
- From: feck@informatik.uni-kl.de (Christoph Feck IRZ)
- Subject: Re: Calling libraries from boopsi objects
- Message-ID: <1994May17.194729@informatik.uni-kl.de>
- Sender: news@uklirb.informatik.uni-kl.de (Unix-News-System)
- Nntp-Posting-Host: uklira.informatik.uni-kl.de
- Organization: University of Kaiserslautern, Germany
- References: <Cpwzx1.3A9@undergrad.math.uwaterloo.ca>
- Date: Tue, 17 May 1994 17:47:29 GMT
- Lines: 43
-
- In article <Cpwzx1.3A9@undergrad.math.uwaterloo.ca>, clgonsal@undergrad.math.uwaterloo.ca (Carl Laurence Gonsalves) writes:
- > I'm working on a simple boopsi gadget, and I'm stuck on one thing:
- >
- > Where do I store library bases, and when should I get them?
-
- Put a pointer to your global (per-class) data in cl->cl_UserData.
- Open all the libraries before you are going to make your class
- handle available.
-
- > The reason I'm asking is this: the dispatcher is called from Intuition's
- > context, while the function that creates the class is called from the
- > application's context. Theoretically, and library bases I get from the
- > app's context might be invalid in Intuition's context, right? (this is the
- > "sharing library bases" issue)
-
- I'd say that exec, graphics, intuition, utility and layers
- are safe to share (Commodore does it, too). If your gadget
- needs other libraries, well, open them in the dispatcher,
- BUT also open them in your class initialization just to make
- sure they are in memory (and stay there until the class is
- freed). If OpenLibrary() would need to load, you could
- end up creating a deadlock, when ramlib puts a 'Please
- insert LIBS:' requester (which you can't disable because
- tasks like input.device don't have pr_WindowPtr...)
-
- > Since I'll probably always be using the libraries within the dispatcher's
- > context (ie: Intuition's) I guess I should open the lib's in the
- > dispatcher, say in the OM_NEW method.
-
- No! The OM_NEW method will be called on the applications
- process, but the GM_HITTEST will be called from input.device.
- You will have to open them whenever you need them, not just
- once in the object creation (which means the library pointers
- are local variables in your dispatcher function, and not
- stored in either per-class or per-object data).
-
- If you have further questions, feel free to ask.
-
- Mr. BOOPSI :)
-
- 3k// Christoph Feck, TowerSystems - BOOPSI Class Development
- \X/ Amiga - Intuition inside.
-